import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

import tailwindcss from 'tailwindcss'



// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueDevTools(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  css: {
    postcss: {
      plugins: [
        tailwindcss({
          content: ['./src/**/*.vue']
        }),
      ]
    },
    loaderOptions: {
      // 给 sass-loader 传递选项
      sass: {
        // 在这里添加你的全局变量
        additionalData: `
          @import "~@fortawesome/fontawesome-free/css/all.min.css";
        `,
      },
    },
  }
})
